package com.gqj.meter.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gqj.common.annotation.Excel;
import com.gqj.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 储位信息对象 MD_STOCK_POS_INFO
 *
 * @author lxq
 * @date lxq-01-09
 */
public class MdStockPosInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 储位标识，本实体记录的唯一标识
     */
    @ApiModelProperty("储位标识")
    private Long storeLocId;

    /**
     * 操作标识
     */
    @ApiModelProperty("操作标识")
    private Long operId;

    /**
     * 储位编号
     */
    @ApiModelProperty("储位编号")
    private String storeLocNo;

    /**
     * 储位条形码
     */
    @ApiModelProperty("储位条形码")
    private String storeLocBarCode;

    /**
     * 储位实际顺序号
     */
    @ApiModelProperty("储位实际顺序号")
    private String storeLocOrder;

    /**
     * 储位类型
     * 01：小储位
     * 02：大储位
     * 03：周转箱储位
     * 06：托盘储位
     */
    @ApiModelProperty("储位类型")
    @Excel(name = "储位类型",dictType = "sl_store_type")
    private String storeType;

    /**
     * 周转柜资产编号，关联的周转柜资产编号
     */
    @ApiModelProperty("周转柜资产编号")
    private String cabinetBarCode;

    /**
     * 柜单元标识，关联的柜单元标识
     */
    @ApiModelProperty("柜单元标识")
    private Long unitId;

    /**
     * 柜单元出厂编号
     */
    @ApiModelProperty("柜单元出厂编号")
    private String unitMadeNo;

    /**
     * 库房标识，用来与库房建立关联
     */
    @ApiModelProperty("库房标识")
    @Excel(name = "库房标识",headerBackgroundColor = IndexedColors.RED1,prompt="请输入系统中对应的库区标识",sort = 1)
    private Long whId;

    /**
     * 库区标识，用来与库区建立关联
     */
    @ApiModelProperty("库区标识")
    private Long whAreaId;

    /**
     * 存放区标识
     */
    @ApiModelProperty("存放区标识")
    private Long storeAreaId;

    /**
     * 档案创建时间
     */
    @ApiModelProperty("档案创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 最后一次修改时间
     */
    @ApiModelProperty("最后一次修改时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 储位状态，01：未占用
     * 02：已占用
     * 03：禁用
     */
    @ApiModelProperty("储位状态")
    private String statusCode;

    /**
     * 储位地址，储位上开关地址，周转柜用来控制储位
     */
    @ApiModelProperty("储位地址")
    private String posAddress;

    /**
     * 主控板地址，单片机主控板地址、一个柜单元可对应一或多个板地址
     */
    @ApiModelProperty("主控板地址")
    private String scmaddress;

    /**
     * 管理单位
     */
    @ApiModelProperty("管理单位")
    @Excel(name = "管理单位")
    private String deptNo;

    /**
     * 名称
     */
    @ApiModelProperty("名称")
    @Excel(name = "名称",headerBackgroundColor = IndexedColors.RED1,prompt="请输入储位名称",sort = 5)
    private String storeLocName;

    /**
     * 存放设备类别，
     * 01：电能表
     * 02：电压互感器
     * 03：电流互感器
     * 04：组合互感器
     * 09：采集终端
     * 21：负控设备
     * 25：采集器
     */
    @ApiModelProperty("存放设备类别")
    @Excel(name = "存放设备类别",dictType = "md_assets_category")
    private String equipTypeCode;

    /**
     * 可存放设备数量
     */
    @ApiModelProperty("可存放设备数量")
    @Excel(name = "可存放设备数量")
    private Integer storeEquipNum;

    /**
     * 可存放周转箱数量
     */
    @ApiModelProperty("可存放周转箱数量")
    private Integer rotateBoxNum;

    /**
     * 描述
     */
    @ApiModelProperty("描述")
    @Excel(name = "描述")
    private String description;

    /**
     * 库房编号
     */
    @ApiModelProperty("库房编号")
    private String whNo;

    /**
     * 库房名称
     */
    @ApiModelProperty("库房名称")
    private String whName;

    /**
     * 库区名称
     */
    @ApiModelProperty("库区名称")
    private String whAreaNo;

    /**
     * 库区名称
     */
    @ApiModelProperty("库区名称")
    private String whAreaname;
    /**
     * 存放区编号
     */
    @ApiModelProperty("存放区编号")
    private String storeAreaNo;

    /**
     * 存放区名称
     */
    @ApiModelProperty("存放区名称")
    private String storeAreaName;

    /*
     *仓储系统储位类型01-垛02-智能柜03-货架04-其他
     */
    @ApiModelProperty("仓储系统储位类型")
    @Excel(name = "储位类型",dictType = "sl_store_type")
    private String storeLocType;

    /*
     *储位余量
     */
    @ApiModelProperty("储位余量")
    @Excel(name = "储位余量")
    private Integer allowance;

    /**
     * 储位主键集合
     */
    @ApiModelProperty("储位主键集合")
    private Long[] storeLocIds;

    /**
     * 实际存放数量
     *
    */
    private Integer actualCount;

    /*
    * 占用率
    * */
    private  String occupancy;

    public String getOccupancy() {
        return occupancy;
    }

    public void setOccupancy(String occupancy) {
        this.occupancy = occupancy;
    }

    public Integer getActualCount() {
        return actualCount;
    }

    public void setActualCount(Integer actualCount) {
        this.actualCount = actualCount;
    }

    public Long[] getStoreLocIds() {
        return storeLocIds;
    }

    public void setStoreLocIds(Long[] storeLocIds) {
        this.storeLocIds = storeLocIds;
    }

    public void setStoreLocId(Long storeLocId) {
        this.storeLocId = storeLocId;
    }

    public Long getStoreLocId() {
        return storeLocId;
    }

    public void setOperId(Long operId) {
        this.operId = operId;
    }

    public Long getOperId() {
        return operId;
    }

    public void setStoreLocNo(String storeLocNo) {
        this.storeLocNo = storeLocNo;
    }

    @NotBlank(message = "储位编号不能为空")
    public String getStoreLocNo() {
        return storeLocNo;
    }

    public void setStoreLocBarCode(String storeLocBarCode) {
        this.storeLocBarCode = storeLocBarCode;
    }

    public String getStoreLocBarCode() {
        return storeLocBarCode;
    }

    public void setStoreLocOrder(String storeLocOrder) {
        this.storeLocOrder = storeLocOrder;
    }

    public String getStoreLocOrder() {
        return storeLocOrder;
    }

    public void setStoreType(String storeType) {
        this.storeType = storeType;
    }

    public String getStoreType() {
        return storeType;
    }

    public void setCabinetBarCode(String cabinetBarCode) {
        this.cabinetBarCode = cabinetBarCode;
    }

    public String getCabinetBarCode() {
        return cabinetBarCode;
    }

    public void setUnitId(Long unitId) {
        this.unitId = unitId;
    }

    public Long getUnitId() {
        return unitId;
    }

    public void setUnitMadeNo(String unitMadeNo) {
        this.unitMadeNo = unitMadeNo;
    }

    public String getUnitMadeNo() {
        return unitMadeNo;
    }

    public void setWhId(Long whId) {
        this.whId = whId;
    }

    @NotNull(message = "库房标识不能为空")
    public Long getWhId() {
        return whId;
    }

    public void setWhAreaId(Long whAreaId) {
        this.whAreaId = whAreaId;
    }

    @NotNull(message = "库区标识不能为空")
    public Long getWhAreaId() {
        return whAreaId;
    }

    public void setStoreAreaId(Long storeAreaId) {
        this.storeAreaId = storeAreaId;
    }

    @NotNull(message = "存放区标识不能为空")
    public Long getStoreAreaId() {
        return storeAreaId;
    }

    public void setStatusCode(String statusCode) {
        this.statusCode = statusCode;
    }

    public String getStatusCode() {
        return statusCode;
    }

    public void setPosAddress(String posAddress) {
        this.posAddress = posAddress;
    }

    public String getPosAddress() {
        return posAddress;
    }

    public void setScmaddress(String scmaddress) {
        this.scmaddress = scmaddress;
    }

    public String getScmaddress() {
        return scmaddress;
    }

    public void setDeptNo(String deptNo) {
        this.deptNo = deptNo;
    }

    public String getDeptNo() {
        return deptNo;
    }

    public void setStoreLocName(String storeLocName) {
        this.storeLocName = storeLocName;
    }

    @NotBlank(message = "储位名称不能为空")
    public String getStoreLocName() {
        return storeLocName;
    }

    public void setEquipTypeCode(String equipTypeCode) {
        this.equipTypeCode = equipTypeCode;
    }

    public String getEquipTypeCode() {
        return equipTypeCode;
    }

    public void setStoreEquipNum(Integer storeEquipNum) {
        this.storeEquipNum = storeEquipNum;
    }

    public Integer getStoreEquipNum() {
        return storeEquipNum;
    }

    public void setRotateBoxNum(Integer rotateBoxNum) {
        this.rotateBoxNum = rotateBoxNum;
    }

    public Integer getRotateBoxNum() {
        return rotateBoxNum;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public String getWhNo() {
        return whNo;
    }

    public void setWhNo(String whNo) {
        this.whNo = whNo;
    }

    public String getWhName() {
        return whName;
    }

    public void setWhName(String whName) {
        this.whName = whName;
    }

    public String getWhAreaNo() {
        return whAreaNo;
    }

    public void setWhAreaNo(String whAreaNo) {
        this.whAreaNo = whAreaNo;
    }

    public String getWhAreaname() {
        return whAreaname;
    }

    public void setWhAreaname(String whAreaname) {
        this.whAreaname = whAreaname;
    }

    public String getStoreAreaNo() {
        return storeAreaNo;
    }

    public void setStoreAreaNo(String storeAreaNo) {
        this.storeAreaNo = storeAreaNo;
    }

    public String getStoreAreaName() {
        return storeAreaName;
    }

    public void setStoreAreaName(String storeAreaName) {
        this.storeAreaName = storeAreaName;
    }

    public String getStoreLocType() {
        return storeLocType;
    }

    public void setStoreLocType(String storeLocType) {
        this.storeLocType = storeLocType;
    }

    public Integer getAllowance() {
        return allowance;
    }

    public void setAllowance(Integer allowance) {
        this.allowance = allowance;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public Date getUpdateTime() {
        return updateTime;
    }

    @Override
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("storeLocId", getStoreLocId())
                .append("operId", getOperId())
                .append("storeLocNo", getStoreLocNo())
                .append("storeLocBarCode", getStoreLocBarCode())
                .append("storeLocOrder", getStoreLocOrder())
                .append("storeType", getStoreType())
                .append("cabinetBarCode", getCabinetBarCode())
                .append("unitId", getUnitId())
                .append("unitMadeNo", getUnitMadeNo())
                .append("whId", getWhId())
                .append("whAreaId", getWhAreaId())
                .append("storeAreaId", getStoreAreaId())
                .append("statusCode", getStatusCode())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("posAddress", getPosAddress())
                .append("scmaddress", getScmaddress())
                .append("deptNo", getDeptNo())
                .append("storeLocName", getStoreLocName())
                .append("equipTypeCode", getEquipTypeCode())
                .append("storeEquipNum", getStoreEquipNum())
                .append("rotateBoxNum", getRotateBoxNum())
                .append("description", getDescription())
                .toString();
    }
}
